package com.test.java01;

public class HelloWorld {
    public static void main(String[] args) {
        Student r1=new Student("乔峰",100,'W');
        Student r2=new Student("鸠摩智",100,'M');
        r1.information();
        System.out.println();
        r2.information();
        while(true){
            //r1攻击r2
            r1.attack(r2);
            //r2的剩余血量
            if(r2.getBlood()==0){
                System.out.println(r1.getName()+"KO了"+
                        r2.getName());
                break;
            }
            //r2攻击r1
            //r1的剩余血量
            if(r1.getBlood()==0){
                System.out.println(r2.getName()+"KO了"+
                        r1.getName());
                break;
            }
        }
    }
}
